<template>
	<view class="wrapper dongTai">
		<div class="center input-box posf">
			<input type="text" placeholder="请输入关键词" placeholder-class="c999 f28" class="flex1" v-model="name"
				@confirm="getdynamic" />
			<image src="../../static/shouye/search.png" mode="widthFix" @click="getdynamic" class="search-icon"></image>
		</div>
		<div class="bfff mt40" v-for="v in dynamic" :key="v.id" @click="open('./xiangXi')">
			<div class="f28 u-line-2 mb10">{{v.reportContent}}</div>
			<div class="f24 c999 tRight">{{v.createTime}}</div>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dynamic: [],
				name: '',
				uinfo: {}
			}
		},
		onLoad() {
			this.uinfo = uni.getStorageSync('uinfo')
			this.getdynamic()
		},
		methods: {
			getdynamic() {
				this.$http('/applet/report/dynamic').then(r => {
					// 有疑问
					this.dynamic = r.filter(f => {
						return f.reportContent.indexOf(this.name) != -1
					})
				})
			}
		}
	}
</script>

<style lang="scss">
	.bfff {
		width: 670rpx;
		padding: 28rpx 40rpx 20rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 24rpx 2rpx rgba(0, 0, 0, 0.16);
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		opacity: 1;
	}

	.input-box {
		width: 670rpx;
		height: 74rpx;
		background: #FFFFFF;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		padding: 0 18rpx 0 20rpx;
		border: 2rpx solid #F3F3F3;
		left: 40rpx;
		top: 40rpx;
		/* #ifdef H5 */
		top: calc(40rpx + 44px);

		/* #endif */
		.search-icon {
			width: 37rpx;
			height: 37rpx;
		}
	}

	.dongTai {
		padding: 114rpx 40rpx;
	}
</style>